
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:acegi="http://sourceforge.net/projects/jsf-comp/acegijsf" 
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">

	<h:messages />

    <h:form> 

       	<h:panelGrid columns="2" style="margin: 0 0 .3em">
	        <h:outputLabel value="Available templates">:</h:outputLabel>
	        <h:panelGroup>
				<h:commandLink value="For normal user (Read only)" immediate="true" action="#{template.readOnly}"/><br/>
				<h:commandLink value="For privileged user (Editable)" immediate="true" action="#{template.fullAccess}"/>
	        </h:panelGroup>
	        <h:panelGroup/>
	        <h:panelGroup> </h:panelGroup>
	        <h:outputLabel value="Date">:</h:outputLabel>
	        <h:inputText id="date" value="#{template.date}" required="true"/>
	        <h:outputLabel value="Address">:</h:outputLabel>
	        <h:inputText id="address" value="#{template.address}" required="true"/>
	        <h:outputLabel value="Email">:</h:outputLabel>
	        <h:inputText id="email" value="#{template.email}" required="true"/>
	        <h:outputLabel value="Phone">:</h:outputLabel>
	        <h:inputText id="phone" value="#{template.phone}" required="true"/>
	        <h:panelGroup/>
	        <h:commandButton value="Preview document" action="#{template.save}"/>
        </h:panelGrid>
        
		<rich:separator lineType="double" width="700"/><br/>
	    <rich:editor bnding="#{template.editor}" value="#{template.content}" theme="advanced" plugins="table" width="700" height="400" required="true">
	    	<f:param name="theme_advanced_buttons1" value="save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect"/>
	    	<f:param name="theme_advanced_buttons2" value="cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|preview,|,forecolor,backcolor"/>
	    	<f:param name="theme_advanced_buttons3" value="tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen"/>
	    </rich:editor>
        
    </h:form>
</html>